package com.link2room.optimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by sss on 2016/9/2.
 */
@Entity
@Table(name = "marketing_campaigns_exdate", catalog = "")
@DynamicInsert
public class MarketingCampaignsExdate extends BaseEntity{
    /**
     * 活动代码
     */
    private String mcCode;
    /**
     * 排除日期
     */
    private Date exdate;
    /**
     * 星期
     */
    private Integer weekd;

    @Basic
    @Column(name = "mc_code", nullable = false, length = 64)
    public String getMcCode() {
        return mcCode;
    }

    public void setMcCode(String mcCode) {
        this.mcCode = mcCode;
    }
    @Basic
    @Column(name = "exdate", nullable = false)
    public Date getExdate() {
        return exdate;
    }

    public void setExdate(Date exdate) {
        this.exdate = exdate;
    }

    @Basic
    @Column(name = "weekd", nullable = true)
    public Integer getWeekd() {
        return weekd;
    }

    public void setWeekd(Integer weekd) {
        this.weekd = weekd;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MarketingCampaignsExdate that = (MarketingCampaignsExdate) o;

        if (mcCode != null ? !mcCode.equals(that.mcCode) : that.mcCode != null) return false;
        if (exdate != null ? !exdate.equals(that.exdate) : that.exdate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mcCode != null ? mcCode.hashCode() : 0;
        result = 31 * result + (exdate != null ? exdate.hashCode() : 0);
        return result;
    }
}
